<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>老人健康体检主表列表</title>
	<#include "/common/resource.ftl">
</head>
<body>

<div class="ui-operation">
    <div class="ui-buttons">
        <div class="layui-btn-group tools">
            <@auth code='elderHealth_add'><button class="layui-btn layui-btn-normal open-dialog" p="url:'${params.contextPath}/view/business/elderHealth/elderHealth_edit.htm',title:'添加老人健康体检信息',width:'90%',height:'100%'"><i class="fa fa-plus"></i>添加</button></@auth>
            <@auth code='elderHealth_update'><button class="layui-btn layui-btn-normal singleSelected" p="url:'${params.contextPath}/view/business/elderHealth/elderHealth_edit.htm',title:'编辑老人健康体检信息',width:'90%',height:'100%'"><i class="fa fa-pencil"></i>修改</button></@auth>
            <@auth code='elderHealth_delete'><button class="layui-btn layui-btn-normal remove-button" reurl="${params.contextPath}/web/elderHealth/delete.json"><i class="fa fa-remove"></i>删除</button></@auth>
        </div>
        <div class="ui-searchs">
            <div class="value"><input type="text" name="name" value="" placeholder="名称"/></div>
            <input type="button" value="搜索" class="layui-btn layui-btn-danger search-button"/>
        </div>
    </div>
</div>
<div class="ui-content" style="padding-left: 10px;padding-right:10px;">
    <table id="datagrid" options="url:'${params.contextPath}/web/elderHealth/list.json',params:'getSearchParams',dblClickRow:'showDetail'">
        <thead>
			<tr>
				<th data-options="field:'id',checkbox:true"></th>
				<th data-options="field:'name',width:100,align:'left'">姓名</th>
                <th data-options="field:'height',width:100,align:'left'">身高(cm)</th>
                <th data-options="field:'weight',width:100,align:'left'">体重(kg)</th>
                <th data-options="field:'waistline',width:100,align:'left'">腰围(cm)</th>
                <th data-options="field:'temperature',width:100,align:'left'">体温(摄氏度)</th>
                <th data-options="field:'pulseRate',width:100,align:'left'">脉率(次/分钟)</th>
                <th data-options="field:'respirationRate',width:100,align:'left'">呼吸频率(次/分钟)</th>
				<th data-options="field:'physicalExaminationTimeStr',width:100,align:'left'">体检日期</th>
				<th data-options="field:'doctorId',width:100,align:'left'">责任医生</th>
				<th data-options="field:'symptom',width:100,align:'left'">症状</th>
				<th data-options="field:'symptomRemark',width:100,align:'left'">其他症状备注</th>
				<th data-options="field:'leftBloodPressure',width:100,align:'left'">左侧血压(mmHg)</th>
				<th data-options="field:'rightBloodPressure',width:100,align:'left'">右侧血压(mmHg)</th>
				<th data-options="field:'bmi',width:100,align:'left'">体质指数(kg/m2)</th>
				<th data-options="field:'healthSelfAppraisal',width:100,align:'left'">健康自我评估</th>
				<th data-options="field:'selfcareAbilityAppraisal',width:100,align:'left'">自理能力自我评估</th>
				<th data-options="field:'cognitiveFunction',width:100,align:'left'">认知功能</th>
				<th data-options="field:'cognitiveFunctionScore',width:100,align:'left'">简易智力状态检查分数</th>
				<th data-options="field:'affectiveState',width:100,align:'left'">情感状态</th>
				<th data-options="field:'affectiveStateScore',width:100,align:'left'">老年人抑郁评分检查分数</th>
			</tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function getSearchParams() {
        return {name: $("input[name='name']").val()};
    }
    var showDetail = function (index, row) {
        <@auth code='elderHealth_detail'>
            var url = "${params.contextPath}/view/business/elderHealth/elderHealth_detail.htm?id=" + row.id;
            DialogManager.openDialog("url:'" + url + "',title:'老人健康体检详情',width:'90%',height:'100%'");
        </@auth>
    };
    //formatter:formatState
    function formatState(val, row) {
    }

    $(function () {
        $(".remove-button").click(function () {
            var ids = DataGrid.getCheckedIds();
            if (ids == "") {
                layer.msg("请选择删除记录")
                return false;
            }
            var url = $(this).attr("reurl");
            layer.confirm('确定删除记录', function () {
                $.ajaxRequest({
                    type: 'post',
                    url: url,
                    data: {ids: ids.join(",")},
                    success: function (data) {
                        $.message(data.message);
                        if (data.success) {
                            DataGrid.reload();
                        }
                    }
                });
            });
        });
    });
</script>
</body>

</html>
